<?php $this->_extends('../_layouts/blank_layout'); ?>
<?php $this->_block('contents'); ?>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/jq.ui.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.ui.js"></script>
<script type="text/javascript">
$(function(){
	$(".datepicker").datepicker({dateFormat:'yy-mm-dd',changeMonth:true});
});
</script>
<form>
<? include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
	From <input class="datepicker" name="begin_date" value="<?=$_GET['begin_date']?>" />
	To <input class="datepicker" name="end_date" value="<?=$_GET['end_date']?>" />
	<input type="hidden" name="source_id" value="<?=$_GET['source_id']?>" />
	<input type="submit" class="button" value="查询" />
</form>
<table width="100%" class="list_table">
<tr>
	<th>Campaign</th>
	<th>IP</th>
	<th>pv</th>
	<th>点击次数</th>
	<th>订单数</th>
	<th>订单总金额</th>
	<th>单张订单金额</th>
</tr>
<?foreach ($campaign as $c):?>
<?if ($c['ip'] || $c['pv'] || $c['adclicks'] || $c['order_count'] || $c['order_amount']):?>
<tr>
	<td><?=$c['name']?></td>
	<td><?=$c['ip']?></td>
	<td><?=$c['pv']?></td>
	<td><?=$c['adclicks']?></td>
	<td><?=$c['order_count']?></td>
	<td>$<?=number_format($c['order_amount'], 2)?></td>
	<td>$<?=($c['order_count']) ? number_format($c['order_amount']/$c['order_count'], 2) : '0.00'?></td>
</tr>
<?endif;?>
<?endforeach;?>
</table>
<?php $this->_endblock();?>